import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author chenhailong
 * @ClassName: Test
 * @Description: TODO
 * @date 2021/9/2 13:33
 * @Version 1.0
 */
public class Test {

    public static void main(String[] args) {

        Collections.synchronizedList(new ArrayList<>());
//
        CopyOnWriteArrayList<Object> objects = new CopyOnWriteArrayList<>();
//
        System.out.println(" 包含:" + Arrays.asList(1, 2).contains(2));
//        String s = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7rNUO5G8tquqMmUXIjV9byLwGfqE4Q32NDarrlRqsctJIYp5PVZbPBGqBWcJnyuM8RwYOiT3B19EvOqbRhlK3MgQ/udtOfpiYqTjLkkuG+FNxXAKkhKiA5uFHeZlI3KQKQjS70KMRQEXxbKlhc8LYa7BVw+xE2K1HKmlyn3oMa3e7jv+LDo4Wg31g57xwFSYyK8/MRR0egjdHzcu3OP0dbRwerUT2ob7pTh+6Uw8WJVQgzQLKp73c6fVTmCcx0sj25zieu27zSd2g4fW+Xui7FosLwabbQRrnrSWg/xGrba8PhAon/ayAy2KBw4liIH1oqCNh9zriGc+k+sT7FN7FAgMBAAECggEAU0xCxHlfX0WdFQpyjrEwwew2iCtsIyzRbOnEEwv66s+LxdT/rvauGPQ80WylfKvwb7CWX51Ka97+WZgOsrCLxgPNHvu++vf1gsyZCMHGBAH0Bzxvb9XxdEUFeFPgVRaZOHRqM3JG7kE4yg8QntBiiuxBN8/d7jC9t/h7FQTzhs7oPf9WEK2wcCcuuxJsDcRdPfolILkl52kFg3G55lIgyiXJzKTGAwHQf/7CM1LPR7NN0lvwozAPCVHV9oHrdKR7x4ajQTs8khkQbByDwmbOPNyj7hNCrJAeLj2nlhfUYXfxjar9+R4tIfe1E378DHtC3gwBmy9ibv41p8pexqyDgQKBgQD3B+vLpTyw2RiMzkbU7IdwEW6aPbTFHc6A6AEVN5FN+s+DXEyTF6HNzBVn45C4TfCI+Wte4MrO3JAiatA4G37LSc0/FL48ck1AQLuxW8nuCVknGK9yodO8iH0mTP2AKtn0oxOa57Iw1hALO+04jlR8/iUJIDc+zMyFebnPGWnkuwKBgQDCfTdxtwlVy7a1IR9K7U0fJ5LwCja6STsP0n/aDcV5YIQTGvZbV7/XMDzsWB+I9c6nnmyY8A1+sKR2LiIJpLEQuKB/hldWb1XeYtoWfT5ffCJ864twNnIPz+AawQBZhGlRC5bqSVdBpnb77Tq4XZbromzbY/WD156jrIVWnJHSfwKBgHyTmAv45mRg9wp7NClIpvyTLe3G1JTbdTp4xaMHhNWIeIHMWCmNr2FzXBAqKN9pHrZU4hrUzjIH9QAGUb8ZzpWCQGlhcpZVJjQS8RR+L5VFTZpzznbGuVrIkiRwix7JfWTroIVr9ua97RVdQUJWNLFcER1LC9E1wqZFPrj8HfTlAoGAThxeNTSO8j9D3RE1cTFHRRjuwatIeZ7JsrwXDytywSHLSaUNhngCm1lLTpzB5Y7bdaSB9xaKRPSKyNAUaY0UdCPCihUZZKSIdy16a4fXkh/X9hXfxayIOOODHRugmVM9vQgLj4LvIXXK2blYWQ11fKOaVq6Zv17M3u1+C+AMDN8CgYEAi/h+0qhu6LLT7iTfd4EF/vgiw8jnCUqQjb6+9e+RzRxFu/hMeCQ0LKBdWbBR6uNAD8kVr73HVnISPXvvozh8Lp2rcgj+hS45BuRkBEGdA6ad6nm3sCFNJ/2PJYDkgPQRUbLjF0DuUxSlfuO55ed//YzXEgnzGsdSW99RrQgxejg=";
//
//        System.out.println(" :" + s.length());

//        get(200000,2);
//        get2(20000,2);
        Deque deque = new ArrayDeque();
        deque.add("aa");
        ArrayBlockingQueue arr = new ArrayBlockingQueue(3);
        LinkedBlockingQueue linkedBlockingQueue = new LinkedBlockingQueue();
        int size = linkedBlockingQueue.size();
        System.out.println(" :" + size);

    }
    public static void get3() {
        int a = 0;
        int b = 0;
        for (int i = 0; i < 3; i++) {
            if (i < 3) {
                a += 100000;
            }
            if (i >4) {
                b = a * 2 / 10;
            }
        }

        // 期满8年之后，全额返还  170900

    }


    /*
    *  8700   5.8     5.6  10W
    *  110000  6600   6600 / 11 =  6
    *
    *
    *
    *
    * */



    public static void get2(int money, int num) {
        int v = money * 3 / 100 ;  // 5年总本金金额
        int preMonth = v / 60;  //  每月本金还款

        // 利率  0.44
        int totalPreMonth = 440 * num + preMonth;  // 本息 月金额
        // 待还本金
        int priMonth = money - v;
        int i1 = totalPreMonth * 60;     // 5年本息
        int i2 = priMonth + i1;  // 总本息
        int i3 = i2 - money;
        System.out.println(" 5年利息:" + i3);
        System.out.println(" 5年利息年化率为:" + i3 / 5 / num / 10);

    }




    public static void get(int money, int num) {

        int total = money;


        int huankuan = 0;  // 每月还款
        int total2 = 0;
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 12; j++) {
                int v = total * 3 / 10 ;  // 5年总本金金额
                int preMonth = v / 60;  //  每月本金还款
                // 利率  0.44
                int totalPreMonth = 440 * num + preMonth;  // 本息 月金额
                total -= totalPreMonth;
                // 待还本金
                int priMonth = total - v;
                int i1 = totalPreMonth * 60;     // 5年本息
                int i2 = priMonth + i1;  // 总本息
                int i3 = i2 - total;

                System.out.println("第" + (i+1) + "年第"+ (j+1) + "月的利息为：" + i3 + "    " +
                        "利率为：" + i3 / 5 /num /10 + "     " +
                        "月还款金额为：" + totalPreMonth + "  " +
                        " 5年本息为：" +   i1 + "  总本息为：" + i2 +
                        "   每月本金还款为：" + preMonth);

            }
            total2 -= huankuan;



        }

//        System.out.println("5年还款本息金额为:" + huankuan);


    }
}
